from sympy import solve, Eq, symbols

# 定义符号变量
x, y = symbols('x y')

# 一元方程
eq1 = Eq(x**2 - 4, 0)
solutions1 = solve(eq1, x)
print("一元方程解:", solutions1)  # [-2, 2]

# 多元方程组
eq2 = Eq(x + y, 5)
eq3 = Eq(x - y, 1)
solutions2 = solve((eq2, eq3), (x, y))
print("方程组解:", solutions2)  # {x: 3, y: 2}

# 不等式求解
inequality = x**2 - 4 > 0
solution_ineq = solve(inequality, x)
print("不等式解:", solution_ineq)